
<script src="jquery-3.5.1.min.js"></script>

<script language="javascript">
function chg(){
jQuery.ajax({
            type: "POST",
            url: 'service.php',
            data: {functionname: 'chj', arguments: [document.getElementById("remark").value]},
            success:function(data) {
                alert(data.toString());
            }
});
}
</script>
 您已登录账号 <strong id="usn"></strong>  <br/>
您的简介:<br/>
<textarea id="remark" cols="30" rows="4" placeholder="请填写个人简介"></textarea>
 <br/>
    <button class="g" onclick="chg()">修改简介</button><br/>
<form action="login_process.php" method="POST">
 <button class="g" onclick="window.location.href='login.html'">登录其它账号</button>
  <input type="submit" value="退出登录">
</form>
<?php

    $json_string = file_get_contents('usr.json');

    $d = json_decode($json_string,true);
    ob_start(); 
    $userName=$_COOKIE['usn'];
    $password=$_COOKIE['pwd'];
ob_end_flush();
    if($d[$userName]['pass']===$password&&$userName!=null){
        echo "<script>document.getElementById('usn').innerHTML='$userName';</script>";
        echo "<script>document.getElementById('remark').innerText='".$d[$userName]['remark']."';</script>";
       
    }else{

        echo "<script type='text/javascript'>";
        echo "window.location.href='login.html'";
        echo "</script>";

    }
